﻿$(function () {
    var tabs;
    var expand = 0;

    tabs = new Swipe(document.getElementById('tabsVote'), {
        callback: function (event, index, elem) {
            setTabVote($("#tabSelectorVote li")[index]);
        }
    });

    $("#tabSelectorVote li").each(function (index, ele) {
        $(ele).attr("data-tab", index);
    });

    $("#tabSelectorVote li").click(function (e) {
        e.preventDefault();
        setTabVote(this);
        tabs.slide(parseInt($(this).attr("data-tab"), 10), 100);
    });


});

function setTabVote(elem) {
    $("#tabSelectorVote a").removeClass("active");
    $(elem).find("a").addClass("active");
}